The next topic is service identity. Just like, your google account is your
identity from the point of view of IAM, cloud run services also
have their own identity. A service account, is a special kind
of account used by machines, and not by users. A service account is identified by
its email address which is unique to the account. Service accounts, differ from
user accounts, in a few key ways. Service accounts do not have passwords,
and cannot log in via browsers, or cookies. You can let other users, or service accounts act on
behalf of a service account. Service accounts are not members
of your Google workspace domain, unlike user accounts,
although you can add them to groups. Service accounts are meant
to be used by machines. Here's one way to look at it. If you run cloud somewhere, for example a
virtual machine in a cloud run service, or as part of a building cloud build, you'll have to access a built in service
account through the service identity. If you use one of the client libraries
to connect to a Google cloud API, they will use this built in
service account to authentication. You can always replace the service account
with your own user managed service account. This is how that works on cloud Run, a container with your application
in It runs on a cloud run worker. The worker has a service account built in, the built in service account is
also known as service identity. If you use a client library to
publish a message to a pub sub q, the client library retrieves an access
token that proves the identity of the service account, and
uses that to call the pub sub API. IAM verifies the access token, and uses the identity in the access token
to check if there's a policy binding.